package com.lantosec.hmrp.modules.morality.entity;

import java.math.BigDecimal;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.morality.vo.MoralityItemVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 * 项目定义 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-16
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MoralityItem extends BaseEntity<MoralityItemVO> {

    private static final long serialVersionUID = 1L;
    public MoralityItem(MoralityItemVO vo){
        this.moralityItemId = vo.getMoralityItemId();
        this.moralityItemName = vo.getMoralityItemName();
        this.moralityItemType = vo.getMoralityItemType();
        this.parentItemId = vo.getParentItemId();
        this.leaf = vo.getLeaf();
        this.itemStandard = vo.getItemStandard();
        this.itemOrder = vo.getItemOrder();
    }

    @Override
    public MoralityItemVO convertToVO(){
        return new MoralityItemVO(this);
    }


    /**
     * 项目ID
     */
    @TableId(value = "morality_item_id", type = IdType.ASSIGN_UUID)
    private String moralityItemId;

    /**
     * 项目名称/内容
     */
    private String moralityItemName;

    /**
     * 项目类型(1基础项目 2一票认定差项目)
     */
    private Integer moralityItemType;

    /**
     * 上级项目ID
     */
    private String parentItemId;

    /**
     * 是否末级(0否 1是)
     */
    private Integer leaf;

    /**
     * 项目标准分(仅基础项目且为末级时可设置)
     */
    private BigDecimal itemStandard;

    /**
     * 排序
     */
    private Integer itemOrder;


    public enum ColName {
        morality_item_id, morality_item_name, morality_item_type, parent_item_id, leaf, item_standard, item_order, 
    }
}
